package com.iflytek.ci.qams.domain;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.base.Strings;
import com.iflytek.framework.web.jackson.CustomDateTimeSerializer;

/**
 * <p>
 * issue_main DB domain
 * </p>
 * 
 * @author poplar.mdzhang
 * @since JDK 1.5
 */
public class Issue implements Serializable {
	/** serial version */
	private static final long serialVersionUID = -6533631481902604752L;
	/** id */
	private long id;
	/** issueID(project_key) */
	private String pkey;
	
	/** 优先级 */
	@Max(value = 5)
	private int priopity;
	
	/** issue type */
	@Max(value=4)
	private int issuetype;
	
	/** issuelabel */
	@Max(value=6)
	private int issuelabel;
	/** project id */
	private long pid;
	/** 项目名称 */
	private String pname;
	/** reporter */
	private String reporter;
	/** 报告人登录名称 */
	private String reporterLogin;
	/** 报告人邮箱 */
	private String reporterMail;
	/** assignee,appointed */
	private String assignee;
	/** 指派者名称 */
	private String assigneeName;
	/** summary,like title */
	private String summary;
	/** description */
	private String description;
	/** environment,such as os */
	private String environment;
	/** created time */
	@JsonSerialize(using = CustomDateTimeSerializer.class)
	private Date created;
	/** updated time */
	@JsonSerialize(using = CustomDateTimeSerializer.class)
	private Date updated;
	/** comment_size */
	private int comment_size;
	/** 最后回复时间 */
	private Date last_comment_time;
	/** 邮件通知 */
	private boolean mail_notify;
	/** 反馈信息状态 */
	private int issuestatus;
	/** 里程碑 */
	private long milestone;
	/** 里程碑名 */
	private String milestone_name;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getPkey() {
		return pkey;
	}

	public void setPkey(String pkey) {
		this.pkey = pkey;
	}

	public int getIssuetype() {
		return issuetype;
	}

	public void setIssuetype(int issuetype) {
		this.issuetype = issuetype;
	}

	public int getIssuelabel() {
		return issuelabel;
	}

	public void setIssuelabel(int issuelabel) {
		this.issuelabel = issuelabel;
	}

	public long getPid() {
		return pid;
	}

	public void setPid(long pid) {
		this.pid = pid;
	}

	public String getReporter() {
		return reporter;
	}

	public void setReporter(String reporter) {
		this.reporter = reporter;
	}

	public String getAssignee() {
		return assignee;
	}

	public void setAssignee(String assignee) {
		this.assignee = assignee;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getEnvironment() {
		return environment;
	}

	public void setEnvironment(String environment) {
		this.environment = environment;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public int getComment_size() {
		return comment_size;
	}

	public void setComment_size(int comment_size) {
		this.comment_size = comment_size;
	}

	/**
	 * 获取报告人邮箱
	 * 
	 * @return 报告人邮箱
	 */
	public String getReporterMail() {
		return reporterMail;
	}

	/**
	 * 设置报告人邮箱
	 * 
	 * @param reporterMail
	 *            报告人邮箱
	 */
	public void setReporterMail(String reporterMail) {
		this.reporterMail = reporterMail;
	}

	/**
	 * 获取优先级
	 * 
	 * @return 优先级
	 */
	public int getPriopity() {
		return priopity;
	}

	/**
	 * 设置优先级
	 * 
	 * @param priopity
	 *            优先级
	 */
	public void setPriopity(int priopity) {
		this.priopity = priopity;
	}

	/**
	 * 获取最后回复时间
	 * 
	 * @return 最后回复时间
	 */
	public Date getLast_comment_time() {
		return last_comment_time;
	}

	/**
	 * 设置 最后回复时间
	 * 
	 * @param last_comment_time
	 *            最后回复时间
	 */
	public void setLast_comment_time(Date last_comment_time) {
		this.last_comment_time = last_comment_time;
	}

	/**
	 * 是否邮件通知回复信息
	 * 
	 * @return 邮件回复
	 */
	public boolean isMail_notify() {
		return mail_notify;
	}

	/**
	 * 是否邮件通知
	 * 
	 * @param mail_notify
	 *            邮件回复
	 */
	public void setMail_notify(boolean mail_notify) {
		this.mail_notify = mail_notify;
	}

	/**
	 * 获取 指派人的名称
	 * 
	 * @return 指派者的名称
	 */
	public String getAssigneeName() {
		if (Strings.isNullOrEmpty(assigneeName)) {
			return assignee;
		}
		return assigneeName;
	}

	/**
	 * 设置指派者名称
	 * 
	 * @param assigneeName
	 *            指派者的名称
	 */
	public void setAssigneeName(String assigneeName) {
		this.assigneeName = assigneeName;
	}

	/**
	 * 获取项目名称
	 * 
	 * @return 项目名称
	 */
	public String getPname() {
		return pname;
	}

	/**
	 * 设置项目名称
	 * 
	 * @param pname
	 *            项目名称
	 */
	public void setPname(String pname) {
		this.pname = pname;
	}

	/**
	 * 获取报告人的登录名称
	 * 
	 * @return 报告人登录名称
	 */
	public String getReporterLogin() {
		return reporterLogin;
	}

	/**
	 * 设置报告人的登录名称
	 * 
	 * @param reporterLogin
	 *            报告人的登录名称
	 */
	public void setReporterLogin(String reporterLogin) {
		this.reporterLogin = reporterLogin;
	}

	/**
	 * 设置反馈信息状态
	 * 
	 * @param issuestatus
	 */
	public void setIssuestatus(int issuestatus) {
		this.issuestatus = issuestatus;
	}

	/**
	 * 获取反馈信息状态
	 * 
	 * @return
	 */
	public int getIssuestatus() {
		return issuestatus;
	}

	/**
	 * 获取反馈信息所在的里程碑
	 * 
	 * @return milestone 里程碑的id
	 */
	public long getMilestone() {
		return milestone;
	}

	/**
	 * 设置反馈信息的里程碑
	 * 
	 * @param milestone
	 *            里程碑id
	 */
	public void setMilestone(long milestone) {
		this.milestone = milestone;
	}

	/**
	 * 获取反馈信息所在里程碑的名字
	 * 
	 * @return 里程碑名
	 */
	public String getMilestone_name() {
		return milestone_name;
	}

	/**
	 * 设置里程碑的名字
	 * 
	 * @param milestone_name
	 *            里程碑名
	 */
	public void setMilestone_name(String milestone_name) {
		this.milestone_name = milestone_name;
	}
}
